﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using CommunitySystem.JinShengService;
using EHR.Common;

namespace CommunitySystem.PageView
{
    public partial class BMFBWindow : ChildWindow
    {
        private BMFBInfo _BMFBInfo = new BMFBInfo() { CreateUser = Session.LoginUser.LoginName, CreateDate = DateTime.Now };
        private JinShengServiceClient client = new JinShengServiceClient();
        public BMFBWindow(BMFBInfo sel)
        {
            InitializeComponent();
            if (sel != null)
            _BMFBInfo = sel;
        
            this.DataContext = _BMFBInfo;

            client.SaveBMFBInfoCompleted += (sender, e) =>
            {
                if (e.Error == null)
                    SilverlightMessageBoxLibrary.Message.InfoMessage("保存成功!");
                this.DialogResult = true;
            };
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
           // this.DialogResult = true;
            _BMFBInfo.Status = "提交";
            client.SaveBMFBInfoAsync(_BMFBInfo,"");
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }
    }
}

